#ifndef RenderNodeImplTS_DEFINED
#define RenderNodeImplTS_DEFINED
#include "OHRenderNode.h"


class RenderNodeImplTS : public OHRenderNode::RenderNodeImpl {
public:
    ~RenderNodeImplTS() override;
    RenderNodeType getNodeType() override { return RenderNodeType::NODE_ARKTS; }
    void *getNodeObject() override;
    void initNode(void *UINode, OHRenderNode *selfNode) override;
    void prepareRedraw(OHRenderNode *node) override;
    void doRedraw(OHRenderNode *node) override;
    SkRect getNodeSize() override;
    void appendRootNode(std::shared_ptr<OHRenderNode> root) override;
    napi_value setLiveWithJs(OHRenderNode *selfNode) override;
    napi_value getLocalJsObject() override;
    napi_status invokeJsFunction(const char *name, size_t argc, const napi_value *argv, napi_value *result,
                                 napi_value node = nullptr);
    void nodeDraw(OH_Drawing_Canvas *oh_canvas, OHRenderNode *selfNode) override;

    static napi_value CreateJsNode();
    static void Destructor(napi_env env, void *nativeObject, void *finalize_hint);

    static void FillOpsForBatch(NodeStatusModify::NodeBatchContext &ctx, NodeStatusModify::NodeModifyInfo &info,
                                void *const (&op_nodes)[3]);
    static void ApplyBatchModify(NodeStatusModify::NodeBatchContext &ctx, napi_value localObject);
private:

    // arkts node ref
    napi_ref fJsObject;
    bool fHasRef = false;
};


#endif //RenderNodeImplTS_DEFINED
